import React, { useState } from "react";

function Demo4() {
  let [inputValue, setInputValue] = useState("");

  function handleClick() {
    setInputValue((inputValue += "这是一段字符串"));
  }
  return (
    <div>
      <input
        type="text"
        value={inputValue}
        onChange={(e) => setInputValue(e.target.value)}
      />
      <button onClick={handleClick}>add</button>
    </div>
  );
}

export default Demo4;
